package com.ddx.common.enums;

/**
 * @author junqiang.wang
 * @ClassName ResultType
 * @Description 返回结果码
 * @Company: www.eloancn.com
 * @date 2016/9/21 15:08
 */

public enum ProductType {


    CURRENT(0,"活期","活期","随存随取"),
    ONE_MONTH_DAY(1,"1个月","定期","1个月"),
    NEW_TENDER(2,"7日","新手专享","7日"),//新手标
    SEVEN_DAY(3,"7日","定期","7日");
    private Integer code;
    private String msg;
    private String type;
    private String rule;

    ProductType(Integer code, String msg,String type,String rule) {
        this.code=code;
        this.msg=msg;
        this.type=type;
        this.rule=rule;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getRule() {
        return rule;
    }

    public void setRule(String rule) {
        this.rule = rule;
    }

    public static ProductType getProductType(Integer code) {
        for (ProductType t : ProductType.values()) {
            if (code.equals(t.getCode())) {
                return t;
            }
        }
        return null;
    }
}
